<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-29 00:51:24
 * @lastTime 2020-04-29 00:54:40
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */
namespace Design\Behavioral\Strategy;

class Context
{

    private $comparator;


    public function __construct(Comparator $comparator)
    {
        $this->comparator = $comparator;

    }//end __construct()


    public function executeStrategy(array $elements) : array
    {
        uasort($elements, [$this->comparator, 'compare']);

        return $elements;

    }//end executeStrategy()


}//end class
